﻿#region Using directives

using System;
using System.IO;

#endregion


namespace StaticPublic.iTunesParser {
    /// <summary>
    /// Parses the command line options to work out what is being done
    /// </summary>
    public class ParserOptions {
        public ParserOptions(string[] arguments) {
            ParseArguments(arguments);
        }


        #region Properties

        /// <summary>
        /// Get/Set the full path to the file to be parsed
        /// </summary>
        public string InputPath { get; set; }

        /// <summary>
        /// Get/Set the full path to the file to be written
        /// </summary>
        public string OutputPath { get; set; }

        #endregion


        private void ParseArguments(string[] arguments) {
            if (arguments == null || arguments.Length < 2) {
                throw new ArgumentException("Not enough arguments supplied");
            }

            InputPath = arguments[0];
            if (!File.Exists(InputPath)) {
                throw new ArgumentException(String.Format("The input file does not exist: {0}", InputPath));
            }

            OutputPath = arguments[1];
        }
    }
}